home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / CursorDevices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  4.9 KB  |  134 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        CursorDevices.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __CURSORDEVICES__
  13. #define __CURSORDEVICES__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22.  
  23. /* Button Operations */
  24.  
  25. enum  {
  26.     kButtonNoOp                    = 0,                            /* No action for this button */
  27.     kButtonSingleClick            = 1,                            /* Normal mouse button */
  28.     kButtonDoubleClick            = 2,                            /* Click-release-click when pressed */
  29.     kButtonClickLock            = 3,                            /* Click on press, release on next press */
  30.     kButtonCharStroke            = 4,                            /* A keystroke, data=(modifiers, char code) */
  31.     kButtonAppleScript            = 5,                            /* An AppleScript */
  32.     kButtonCustom                = 6                                /* Custom behavior, data=proc pointer */
  33. };
  34.  
  35.  
  36. /* Device Classes */
  37.  
  38. enum  {
  39.     kDeviceClassAbsolute        = 0,                            /* a flat-response device */
  40.     kDeviceClassMouse            = 1,                            /* mechanical or optical mouse */
  41.     kDeviceClassTrackball        = 2,                            /* trackball */
  42.     kDeviceClassScratchPad        = 3,                            /* (midas) */
  43.     kDeviceClassJoystick        = 4,                            /* (homeRow) */
  44.     kDeviceClassRelTablet        = 5                                /* relative tablet */
  45. };
  46.  
  47.  
  48. /* Structures used in Cursor Device Manager calls */
  49.  
  50. typedef struct CrsrData CrsrData, *CrsrDataPtr;
  51.  
  52. #if defined(powerc) || defined (__powerc)
  53. #pragma options align=mac68k
  54. #endif
  55. struct CrsrData {
  56.     CrsrDataPtr                    nextCrsrData;                    /* next in global list */
  57.     Ptr                            displayInfo;                    /* unused (reserved for future) */
  58.     Fixed                        whereX;                            /* horizontal position */
  59.     Fixed                        whereY;                            /* vertical position */
  60.     Point                        where;                            /* the pixel position */
  61.     Boolean                        isAbs;                            /* has been stuffed with absolute coords */
  62.     unsigned char                ButtonCount;                    /* number of buttons currently pressed */
  63.     unsigned short                ScreenRes;                        /* pixels per inch on the current display */
  64. };
  65. #if defined(powerc) || defined(__powerc)
  66. #pragma options align=reset
  67. #endif
  68.  
  69. typedef struct CrsrDevice CrsrDevice, *CrsrDevicePtr;
  70.  
  71. #if defined(powerc) || defined (__powerc)
  72. #pragma options align=mac68k
  73. #endif
  74. struct CrsrDevice {
  75.     CrsrDevicePtr                nextCrsrDev;                    /* pointer to next record in linked list */
  76.     CrsrDataPtr                    whichCursor;                    /* pointer to data for target cursor */
  77.     long                        refCon;                            /* applicaiton-defined */
  78.     long                        unused;                            /* reserved for future */
  79.     OSType                        devID;                            /* device identifier (from ADB reg 1) */
  80.     Fixed                        resolution;                        /* units/inch (orig. from ADB reg 1) */
  81.     unsigned char                devClass;                        /* device class (from ADB reg 1) */
  82.     unsigned char                cntButtons;                        /* number of buttons (from ADB reg 1) */
  83.     char                        spare1;                            /* reserved for future */
  84.     unsigned char                buttons;                        /* state of all buttons */
  85.     unsigned char                buttonOp[8];                    /* action performed per button */
  86.     unsigned long                buttonTicks[8];                    /* ticks when button last went up (for debounce) */
  87.     long                        buttonData[8];                    /* data for the button operation */
  88.     unsigned long                doubleClickTime;                /* device-specific double click speed */
  89.     Fixed                        acceleration;                    /* current acceleration */
  90.     short                        privateFields[15];                /* fields used internally to CDM */
  91. };
  92. #if defined(powerc) || defined(__powerc)
  93. #pragma options align=reset
  94. #endif
  95.  
  96. #ifdef __cplusplus
  97. extern "C" {
  98. #endif
  99.  
  100. extern pascal OSErr CrsrDevMove(CrsrDevicePtr ourDevice, long deltaX, long deltaY)
  101.  THREEWORDINLINE(0x303C, 0x0000, 0xAADB);
  102. extern pascal OSErr CrsrDevMoveTo(CrsrDevicePtr ourDevice, long absX, long absY)
  103.  THREEWORDINLINE(0x303C, 0x0001, 0xAADB);
  104. extern pascal OSErr CrsrDevFlush(CrsrDevicePtr ourDevice)
  105.  THREEWORDINLINE(0x303C, 0x0002, 0xAADB);
  106. extern pascal OSErr CrsrDevButtons(CrsrDevicePtr ourDevice)
  107.  THREEWORDINLINE(0x303C, 0x0003, 0xAADB);
  108. extern pascal OSErr CrsrDevButtonDown(CrsrDevicePtr ourDevice)
  109.  THREEWORDINLINE(0x303C, 0x0004, 0xAADB);
  110. extern pascal OSErr CrsrDevButtonUp(CrsrDevicePtr ourDevice)
  111.  THREEWORDINLINE(0x303C, 0x0005, 0xAADB);
  112. extern pascal OSErr CrsrDevButtonOp(CrsrDevicePtr ourDevice)
  113.  THREEWORDINLINE(0x303C, 0x0006, 0xAADB);
  114. extern pascal OSErr CrsrDevSetButtons(CrsrDevicePtr ourDevice)
  115.  THREEWORDINLINE(0x303C, 0x0007, 0xAADB);
  116. extern pascal OSErr CrsrDevSetAcceleration(CrsrDevicePtr ourDevice)
  117.  THREEWORDINLINE(0x303C, 0x0008, 0xAADB);
  118. extern pascal OSErr CrsrDevDoubleTime(CrsrDevicePtr ourDevice)
  119.  THREEWORDINLINE(0x303C, 0x0009, 0xAADB);
  120. extern pascal OSErr CrsrDevUnitsPerInch(CrsrDevicePtr ourDevice)
  121.  THREEWORDINLINE(0x303C, 0x000A, 0xAADB);
  122. extern pascal OSErr CrsrDevNextDevice(CrsrDevicePtr *ourDevice)
  123.  THREEWORDINLINE(0x303C, 0x000B, 0xAADB);
  124. extern pascal OSErr CrsrDevNewDevice(CrsrDevicePtr *ourDevice)
  125.  THREEWORDINLINE(0x303C, 0x000C, 0xAADB);
  126. extern pascal OSErr CrsrDevDisposeDevice(CrsrDevicePtr ourDevice)
  127.  THREEWORDINLINE(0x303C, 0x000D, 0xAADB);
  128. #ifdef __cplusplus
  129. }
  130. #endif
  131.  
  132. #endif
  133.  
  134.